<template>
	<view>
		<view class="content" style="font-size: 50rpx;">
			子组件B
		</view>
		<view class="b-box">
			ComA组件传进来的值
			<text class="intent-text-box">{{result}}</text>
		</view>
		<view class="b-box" style="margin: 10rpx;">
			<text>回传值</text>
			<input type="text" v-model="callBackValue" style="color: red;" />
			<button @click="sendOutside()" size="mini">回传</button>
		</view>
	</view>
</template>

<script>
	export default {
		name: "ComB",
		data() {
			return {
				callbackValue:""
			};
		},
		methods: {
			sendOutside() {
				console.log("----ComB----sendOutside------>" + this.callbackValue);
				this.$emit('callBackFun', this.callbackValue);
			},
			created() {
				uni.$on('geyIntent', (msg) => {
					console.error("----ComB----getIntent---->" + this.msg);
					this.result = msg;
				})
			}
		}

	}
</script>

<style>

</style>